package com.smdd.project.service.impl;

import com.smdd.project.dao.UserRepository;
import com.smdd.project.entity.UserInfo;
import com.smdd.project.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName UserServiceImpl
 * @Description TODO
 * @Author wyp
 * @Date 2023/7/7 12:39
 * @Version 1.0
 */
@Service
public class UserServiceImpl implements UserService {
    private final UserRepository userRepository;

    @Autowired
    public UserServiceImpl(UserRepository userRepository) {
        this.userRepository = userRepository;
    }

    @Override
    public UserInfo getUserInfo(String id) {
        return this.userRepository.findById(Long.parseLong(id)).orElse(null);
    }
}
